﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using Adatkezelo.Classes;
namespace NEMProjectWebApp.Pages.Oktato {
    public partial class vizsgaKezeles : System.Web.UI.Page {
        vizsgakerdesKezeles vizsgakerdes = new vizsgakerdesKezeles();
        Vizsgakerdessor_kezelese kerdessor = new Vizsgakerdessor_kezelese();
        Login_Kezeles login = new Login_Kezeles();
        SQLDataManipulation sql = new SQLDataManipulation();
        protected void Page_Load(object sender, EventArgs e) {
            string redirect = login.BelepesiJogkorEll(Session, 3);
            if (redirect.Length > 0) Response.Redirect(redirect);
        }

        public void dataBinding() {

        }

        public void TargyDropDownList_SelectedIndexChanged(object sender, EventArgs e) {

        }

        public void VizsgasorokDropDownList_SelectedIndexChanged(object sender, EventArgs e) {

        }

        protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) {

        }

        protected void MentesButton_Click(object sender, EventArgs e) {
            if (ListBox2.Items != null) {
                int[] kerdesek = new int[ListBox2.Items.Count];
                for (int i = 0; i < ListBox2.Items.Count; i++) {
                    kerdesek[i] = int.Parse(ListBox2.Items[i].Value);
                }
                if (Textbox1.Text != "")
                    kerdessor.VizsgaSorLetrehoz(Textbox1.Text, int.Parse(TargyDropDownList.SelectedValue), kerdesek, int.Parse(RadioButtonList1.SelectedValue));
            }
        }

        protected void HozzaadVizsgahozButton_Click(object sender, EventArgs e) {
            if (ListBox1.SelectedItem != null)
                ListBox2.Items.Add(ListBox1.SelectedItem);
        }

        protected void ElveszVizsgabolButton_Click(object sender, EventArgs e) {
            if (ListBox2.SelectedItem != null)
                ListBox2.Items.Remove(ListBox2.SelectedItem);
        }
    }
}